<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
		"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>

	<title>Test Dijit Internal Event: "ondijitclick"</title>

	<script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug: true"></script>
	<script type="text/javascript">
		dojo.require("dijit.dijit"); // optimize: load dijit layer
		dojo.require("dijit.robotx");

		dojo.addOnLoad(function(){
			doh.robot.initRobot('../_Widget-ondijitclick.html');

			// Event monitoring
			var widgetClicks = 0, buttonClicks = 0;
			var w;

			doh.register("ondijitclick w/mouse",
				function runTest(){ 
					var d = new doh.Deferred();
	
					doh.robot.sequence(function(){
						w = dijit.byId("first");
						dojo.connect(w, "_onClick", function(){
							widgetClicks++;
						}),
						dojo.connect(dojo.byId("plainbutton"), "onclick", function(){
							buttonClicks++;
						})
						w.domNode.focus();
					}, 100);
	
					// click the widget
					doh.robot.mouseMoveAt("first", 100);
					doh.robot.mouseClick({left: true}, 100);

					doh.robot.sequence(d.getTestCallback(function(){
						doh.is(1, widgetClicks, "ondijitclick handler fired once");
					}), 100);
	
					return d;
				}
			);

			doh.run();
		});

	</script>
</head>
</html>
